import Pagination from '@/components/Pagination'
export default {
	data() {
		return {
			data: [],
			editData:{},
			show:false,
			edit:false,
			Request:{
				fromDate:"",
				flightNo:"",
				pageNum:1,
				pageSize:10,
			},
			flightNoList: [{
				value: "MU123",
				label: "MU123",
			}, ],
		}
	},
	computed: {

	},
	watch: {

	},
	methods: {
		search(){
			this.$http.post('api/class',this.Request)
				.then((res) => {
					if(res.data.code=='601'){
						this.show = true;
						let data = res.data.data.list;
						for(let i=0;i<data.length;i++){
							data[i].show = false;
						}				
						this.data = data;						
						return;
					}
					//请求失败的处理
					this.show = false;
					this.$Notice.error({
	                    title: '查询失败',
	                    desc: res.data.message
	                });
				})
				.catch((err) => {
					//请求失败的处理
					this.show = false;
					this.$Notice.error({
						title: '查询失败',
						desc: err
					});
					return false;
				})
		},
		showDetail(flight){
			flight.show = !flight.show;
		},
		doEdit(flight){
			this.edit = true;
			this.editData = JSON.parse(JSON.stringify(flight));
		},
		sureEdit(){
			
		},
		getLayoutCount(detail){
			for(let i=0;i<detail.length;i++){
				if(detail[i].layoutCount!=null){
					return detail[i].layoutCount;
				}
			}
		},
		
	},
	components: {
		Pagination
	},
	created() {
		this.search();
	}
}